package com.github.boluo1230.wechat.entity.message;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class WxCustomText implements WxCustomMsg, Serializable {
    @JsonProperty(value = "touser")
    private String toUser;

    @JsonProperty(value = "msgtype")
    private String msgType = "text";

    @JsonProperty(value = "text")
    private WxCustomText.Text text;

    public WxCustomText(String openId, String content) {
        this.setToUser(openId);
        this.setText(new WxCustomText.Text(content));
    }

    @Getter
    @Setter
    public class Text {
        @JsonProperty(value = "content")
        private String content;

        public Text(String mediaId) {
            this.setContent(mediaId);
        }
    }
}
